#include <bits/stdc++.h>
using namespace std;
#define int long long
string s;
void C()
{
    for(int i=0;i<s.size();i++)
    {
        if(s[i]<='z'&&s[i]>='a')
        {
            int x=s[i]-'a'-3;
            if(x<0)x+=26;
            s[i]='a'+x;
        }
        if(s[i]<='Z'&&s[i]>='A')
        {
            int x=s[i]-'A'-3;
            if(x<0)x+=26;
            s[i]='A'+x;
        }
    }
}
void M()
{
    for(int i=0;i<s.size();i++)
    {
        if(s[i]<='z'&&s[i]>='a')
        {
            int x=s[i]-'a';
            x=25-x;
            s[i]='a'+x;
        }
        if(s[i]<='Z'&&s[i]>='A')
        {
            int x=s[i]-'A';
            x=25-x;
            s[i]='A'+x;
        }
    }
}
void F()
{
    string tmp;
    bool f=s.size()%2;
    int x=s.size()/2;
    s=' '+s;
    if(!f)
    {
        for(int i=1;i<=x;i++)
        {
            tmp+=s[i];
            tmp+=s[i+x];
        }
    }
    else 
    {
        for(int i=1;i<=x;i++)
        {
            tmp+=s[i];
            tmp+=s[i+x+1];
        }
        tmp+=s[x+1];
    }
    s=tmp;
}
void solve()
{
    int n;
    cin>>n;
    vector<char> v(n+1);
    for(int i=i=1;i<=n;i++)
    {
        cin>>v[i];
    }
    cin>>s;
    for(int i=n;i>=1;i--)
    {
        if(v[i]=='C')C();
        if(v[i]=='M')M();
        if(v[i]=='F')F();
    }
    cout<<s;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}